﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PinLayoutMVC.Core;

namespace PinLayoutMVC.Models
{
    public class AnswerModel
    {
        public int QuestionID { get; set; }
        public int ID { get; set; }
        public int Number { get; set; }
        public string Text { get; set; }
        public EAnswerCategory Category { get; set; }
        public int LeadsToQuestion { get; set; }

        public enum EAnswerCategory
        {
            Date,
            Email,
            Open
        }

        public Boolean Validate()
        {
            if (string.IsNullOrEmpty(Text)) return false;

            return true;
        }

        public static EAnswerCategory GetAnswerCategory(long? id)
        {
            EAnswerCategory AnswerCategory = new EAnswerCategory();

            switch (id)
            {

                case 0:
                    AnswerCategory = EAnswerCategory.Date;
                    break;
                case 1:
                    AnswerCategory = EAnswerCategory.Email;
                    break;
                default:
                    AnswerCategory = EAnswerCategory.Open;
                    break;
            }
            
            return AnswerCategory;
        }

    }
}